<template>
  <div>
    <el-table :data="list" height="180" size="small">
      <el-table-column
        label="采集时间"
        align="center"
        prop="time"
        width="160"
      />
      <el-table-column label="氧含量" width="100" align="center" prop="oxygen" />
      <el-table-column label="舱室压力" align="center" width="100" prop="cabinPressure" />
      <el-table-column
        label="滤网压差"
        align="center"
        width="100"
        prop="filterPressureDiff"
      />
      <el-table-column label="风机流速" width="100" align="center" prop="fanFlux" />
      <el-table-column
        label="基板温度"
        align="center"
        width="100"
        prop="buildCylinderTemperature"
      />
      <el-table-column label="管道温度" width="110" align="center" prop="fanPipeTemp" />
      <el-table-column label="打印层数" align="center" prop="currentLayerFinished" />
      <el-table-column label="设备状态" align="center" prop="fanPipeTemp" :formatter="statusFormat"/>
    </el-table>
    <!-- <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    /> -->
  </div>
</template>

<script>
import { getDataCollectData } from "@/api/technology/working";
export default {
  props: ["id", "equipmentId"],
  data() {
    return {
      total: 0,
      list: [],
      tableHead: [],
      queryParams: {
        workingId: "",
        equipmentId: this.equipmentId,
        pageNum: 1,
        pageSize: 10,
      },
      statusOptions:[]
    };
  },
  created(){
     // 设备状态
    this.getDicts("equipment_info_status").then((response) => {
      this.statusOptions = response.data;
    });
  },
  watch: {
    id(newId) {
      this.list = [];
      this.total = 0;
      this.queryParams = {
        workingId: "",
        equipmentId: "",
        pageNum: 1,
        pageSize: 100,
      };
      if (newId == "") {
        return;
      }
      this.queryParams.workingId = newId;
      (this.queryParams.equipmentId = this.equipmentId),
        // this.getEquipmentParam(this.queryParams.equipmentId);
        this.getList();
    },
  },
  methods: {
    // 任务状态字典翻译
    statusFormat(row, column) {
      return this.selectDictLabel(this.statusOptions, row.status);
    },
    //  getEquipmentParam(id) {
    //   getEquipmentParam(id).then((res) => {
    //       this.tableHead=res.data
    //       this.getList()
    //   });
    // },
    getList() {
      getDataCollectData(this.queryParams).then((response) => {
        this.list = response.data;
        // this.total = response.total;
        this.loading = false;
      });
    },
  },
};
</script>

<style>
</style>